import cv2
import numpy as np


#
def test():
    #
    img = cv2.imread('card.png')

    #
    gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
    # 使用Canny算子进行边缘检测
    edges = cv2.Canny(gray_img, 50, 150, apertureSize=3)

    lines = cv2.HoughLines(edges, 1, np.pi / 180, 200)
    print(type(lines))

    # 显示结果
    cv2.imshow('Transformed Image', lines)
    cv2.waitKey(0)
    cv2.destroyAllWindows()


if __name__ == '__main__':
    test()
